import { QNSContext, ProxyInvokeContext, ConnectToPilotContext, PilotFuncInvokeContext, LoginToPilotContext, PublishBOContext, ProxyLoginCommandContext, ProxyLogoutCommandContext, RemoteProxyInvokeContext } from '../model/contexts';
import { OptionObserver } from './pilot-context-broker';
import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
import { Subject } from "rxjs/Subject";
import { ReplaySubject } from "rxjs/ReplaySubject";

export interface IPilotContextBroker {

    pilotObserver: Subject<any>;

    pilotLoginInfoObserver: ReplaySubject<any>;

    query(context: QNSContext, optionObserver?: OptionObserver): Observable<any>;

    sub(context: QNSContext, optionObserver?: OptionObserver): Observable<any>;

    qns(context: QNSContext, optionObserver?: OptionObserver): Observable<any>;

    invokeProxy(context: ProxyInvokeContext, optionObserver?: OptionObserver): Observable<any>;

    connectToPilot(contextToPilot: ConnectToPilotContext): void;

    cancelSubscription(subscription: Subscription, requestId?: string): void;

    uuid(): string;

    setUpOptionObserver(optionObserver: OptionObserver): void;

    disconnect(): void;

    invokePilotFunc(context: PilotFuncInvokeContext): Promise<any>;

    loginToPilot(loginToPilotContext: LoginToPilotContext): Promise<any>;

    proxyLogin(context: ProxyLoginCommandContext): Promise<any>;

    proxyLogout(context: ProxyLogoutCommandContext): Promise<any>;

    invokeRemoteProxy(context: RemoteProxyInvokeContext): Promise<any>;

    publish(context: PublishBOContext): Promise<any>;
}